package com.biancheng.biancheng.biancheng2;

import java.util.Scanner;

public class 丑数 {
    //  丑数
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();//数字以字符串的形式输入的
        Boolean flag =false;
        if(num == 1){
            flag = true;
        }else{
            flag = isUglyRecursive(num);
        }
        System.out.println(flag);
        if(num==1){
            System.out.println("true");
        }else{
            System.out.println("false");
        }
    }

    public static boolean isUglyRecursive(int n) {
        int n2 = n;
        if (n2 >= 2 && n2 % 2 == 0) {
            n2 = n2 / 2;
            return isUglyRecursive(n2);
        }
        int n3 = n2;
        if (n2 >= 3 && n3 % 3 == 0) {
            n3 = n3 / 3;
            return isUglyRecursive(n3);
        }
        int n5 = n3;
        if (n2 >= 5 && n5 % 5 == 0) {
            n5 = n5 / 5;
            return isUglyRecursive(n5);
        }
        return n5 == 1;

    }

}
